package day0725API;

import java.io.*;

public class Test12 {
    public static void main(String[] args) {
        long t1=System.currentTimeMillis();
        try(FileInputStream fis=new FileInputStream("src/day0725API/Test1.java");
            InputStreamReader  isr=new InputStreamReader(fis);
            BufferedReader br=new BufferedReader(isr)){
            String str="";
            while(  (str=br.readLine())  !=null){
                System.out.println(str);
            }

        }catch (IOException e){
            e.printStackTrace();//打印异常详细信息
            System.out.println(e.getMessage());

        }finally {
            System.out.println("Over");
        }
        long t2=System.currentTimeMillis();
        System.out.println(t2-t1);





        long time1=System.currentTimeMillis();
        try(FileInputStream fis=new FileInputStream("src/day0725API/Test1.java");
            BufferedInputStream bis=new BufferedInputStream(fis);
            InputStreamReader  isr=new InputStreamReader(bis);){
            int data=-1;
            while(  (data=isr.read())!=-1){
                System.out.print((char)data);
            }

        }catch (IOException e){
            e.printStackTrace();
        }finally {
            System.out.println("完毕");
        }
        long time2=System.currentTimeMillis();
        System.out.println(time2-time1);

    }
}
